import ddddocr


def verify_code(filepath):
    # 创建ddddocr对象
    ocr = ddddocr.DdddOcr()

    # 读取验证码图片的bytes数据
    with open(filepath, 'rb') as f:
        img_bytes = f.read()

    # 使用ddddocr进行识别
    result = ocr.classification(img_bytes)
    return result
